﻿using Dapper.Contrib.Extensions;
using Gx.Common;
using Gx.Model.Enums;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Gx.Model.Entity
{
    [System.ComponentModel.DataAnnotations.Schema.Table("LK_SettlementPaymentDetail")]
    public class LKSettlementPaymentDetail
    {
        [System.ComponentModel.DataAnnotations.Key]
        private int _id;
        /// <summary>
        /// Id
        /// </summary>
        [Column("Id")]
        public int Id
        {
            get
            {
                return _id;
            }
            set { _id = value; }
        }


        private int _settlementId;
        /// <summary>
        /// 结算id
        /// </summary>
        [Column("SettlementId")]
        public int SettlementId
        {
            get
            {
                return _settlementId;
            }
            set { _settlementId = value; }
        }


        private System.DateTime _beginTime;
        /// <summary>
        /// 日期
        /// </summary>
        [Column("BeginTime")]
        public System.DateTime BeginTime
        {
            get
            {
                if (_beginTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _beginTime;
            }
            set { _beginTime = value; }
        }


        private System.DateTime _endTime;
        /// <summary>
        /// 截止日期
        /// </summary>
        [Column("EndTime")]
        public System.DateTime EndTime
        {
            get
            {
                if (_endTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _endTime;
            }
            set { _endTime = value; }
        }


        private int _days;
        /// <summary>
        /// 天数
        /// </summary>
        [Column("Days")]
        public int Days
        {
            get
            {
                return _days;
            }
            set { _days = value; }
        }


        private string _goodsNo;
        /// <summary>
        /// 商品批次
        /// </summary>
        [Column("GoodsNo")]
        public string GoodsNo
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_goodsNo))
                    _goodsNo = string.Empty;
                return _goodsNo;
            }
            set { _goodsNo = value; }
        }


        private int _goodsId;
        /// <summary>
        /// 商品id;
        /// </summary>
        [Column("GoodsId")]
        public int GoodsId
        {
            get
            {
                return _goodsId;
            }
            set { _goodsId = value; }
        }


        private string _goodsName;
        /// <summary>
        /// 商品名称
        /// </summary>
        [Column("GoodsName")]
        public string GoodsName
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_goodsName))
                    _goodsName = string.Empty;
                return _goodsName;
            }
            set { _goodsName = value; }
        }


        private int _goodsSpecId;
        /// <summary>
        /// 规格;
        /// </summary>
        [Column("GoodsSpecId")]
        public int GoodsSpecId
        {
            get
            {
                return _goodsSpecId;
            }
            set { _goodsSpecId = value; }
        }


        private string _goodsSpecName;
        /// <summary>
        /// 规格名称
        /// </summary>
        [Column("GoodsSpecName")]
        public string GoodsSpecName
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_goodsSpecName))
                    _goodsSpecName = string.Empty;
                return _goodsSpecName;
            }
            set { _goodsSpecName = value; }
        }


        private string _costType;
        /// <summary>
        /// 类型
        /// </summary>
        [Column("CostType")]
        public string CostType
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_costType))
                    _costType = string.Empty;
                return _costType;
            }
            set { _costType = value; }
        }


        private string _containerNumber;
        /// <summary>
        /// 柜号
        /// </summary>
        [Column("ContainerNumber")]
        public string ContainerNumber
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_containerNumber))
                    _containerNumber = string.Empty;
                return _containerNumber;
            }
            set { _containerNumber = value; }
        }


        private decimal _weight;
        /// <summary>
        /// 件重
        /// </summary>
        [Column("Weight")]
        public decimal Weight
        {
            get
            {
                return _weight;
            }
            set { _weight = value; }
        }


        private int _number;
        /// <summary>
        /// 件数
        /// </summary>
        [Column("Number")]
        public int Number
        {
            get
            {
                return _number;
            }
            set { _number = value; }
        }


        private decimal _tonWeight;
        /// <summary>
        /// 吨重
        /// </summary>
        [Column("TonWeight")]
        public decimal TonWeight
        {
            get
            {
                return _tonWeight;
            }
            set { _tonWeight = value; }
        }


        private decimal _area;
        /// <summary>
        /// 托盘数/面积
        /// </summary>
        [Column("Area")]
        public decimal Area
        {
            get
            {
                return _area;
            }
            set { _area = value; }
        }


        private int _plateNumber;
        /// <summary>
        /// 板数
        /// </summary>
        [Column("PlateNumber")]
        public int PlateNumber
        {
            get
            {
                return _plateNumber;
            }
            set { _plateNumber = value; }
        }


        private decimal _coldUnitPrice;
        /// <summary>
        /// 冷藏单价
        /// </summary>
        [Column("ColdUnitPrice")]
        public decimal ColdUnitPrice
        {
            get
            {
                return _coldUnitPrice;
            }
            set { _coldUnitPrice = value; }
        }


        private decimal _coldCost;
        /// <summary>
        /// 冷藏费用
        /// </summary>
        [Column("ColdCost")]
        public decimal ColdCost
        {
            get
            {
                return _coldCost;
            }
            set { _coldCost = value; }
        }


        private decimal _chuzhi;
        /// <summary>
        /// 处置费
        /// </summary>
        [Column("Chuzhi")]
        public decimal Chuzhi
        {
            get
            {
                return _chuzhi;
            }
            set { _chuzhi = value; }
        }


        private decimal _zhuangxie;
        /// <summary>
        /// 装卸费
        /// </summary>
        [Column("Zhuangxie")]
        public decimal Zhuangxie
        {
            get
            {
                return _zhuangxie;
            }
            set { _zhuangxie = value; }
        }


        private decimal _jiaban;
        /// <summary>
        /// 加班费
        /// </summary>
        [Column("Jiaban")]
        public decimal Jiaban
        {
            get
            {
                return _jiaban;
            }
            set { _jiaban = value; }
        }


        private decimal _fenjian;
        /// <summary>
        /// 分检费
        /// </summary>
        [Column("Fenjian")]
        public decimal Fenjian
        {
            get
            {
                return _fenjian;
            }
            set { _fenjian = value; }
        }


        private decimal _guobang;
        /// <summary>
        /// 过磅费
        /// </summary>
        [Column("Guobang")]
        public decimal Guobang
        {
            get
            {
                return _guobang;
            }
            set { _guobang = value; }
        }


        private decimal _peisong;
        /// <summary>
        /// 配送费
        /// </summary>
        [Column("Peisong")]
        public decimal Peisong
        {
            get
            {
                return _peisong;
            }
            set { _peisong = value; }
        }


        private decimal _qita;
        /// <summary>
        /// 其他费
        /// </summary>
        [Column("Qita")]
        public decimal Qita
        {
            get
            {
                return _qita;
            }
            set { _qita = value; }
        }


        private System.DateTime _createTime;
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("CreateTime")]
        public System.DateTime CreateTime
        {
            get
            {
                if (_createTime == DateTime.MinValue)
                {
                    return DateTime.Now;//DateTime.Parse("1911-01-01");
                }
                return _createTime;
            }
            set { _createTime = value; }
        }


        private bool _isDeleted;
        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("IsDeleted")]
        public bool IsDeleted
        {
            get
            {
                return _isDeleted;
            }
            set { _isDeleted = value; }
        }

        [Computed]
        public decimal TotalAmount
        {
            get
            {
                return ColdCost + Chuzhi + Zhuangxie + Jiaban + Fenjian + Guobang + Peisong + Qita;
            }
        }
    }
}

